]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Calendar: hide all actions when on the login screen
authorMatthias Clasen <mclasen@redhat.com>
Tue, 2 Oct 2012 17:32:55 +0000 (19:32 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 8 Oct 2012 17:48:44 +0000 (19:48 +0200)
No events on the login screen, and no opening calendars or
settings either.

https://bugzilla.gnome.org/show_bug.cgi?id=685142

js/ui/dateMenu.js

index 2c455821d89ca207b545b27c4879cb4e62b22d81..7f01a76150004c5f228978b11ce303ff92619b9d 100644 (file)
@@ -89,8 +89,10 @@ const DateMenuButton = new Lang.Class({
             separator.setColumnWidths(1);
             vbox.add(separator.actor, {y_align: St.Align.END, expand: true, y_fill: false});
 
+            item.actor.show_on_set_parent = false;
             item.actor.can_focus = false;
             item.actor.reparent(vbox);
+            this._dateAndTimeSeparator = separator;
         }
 
         this._separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
@@ -145,9 +147,18 @@ const DateMenuButton = new Lang.Class({
     },
 
     _setEventsVisibility: function(visible) {
+        this._openCalendarItem.actor.visible = visible;
         this._separator.visible = visible;
-        this._eventList.visible = visible;
-        this._openCalendarItem.visible = visible;
+        if (visible) {
+          let alignment = 0.25;
+          if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
+            alignment = 1.0 - alignment;
+          this.menu._arrowAlignment = alignment;
+          this._eventList.actor.get_parent().show();
+        } else {
+          this.menu._arrowAlignment = 0.5;
+          this._eventList.actor.get_parent().hide();
+        }
     },
 
     _setEventSource: function(eventSource) {
@@ -165,6 +176,10 @@ const DateMenuButton = new Lang.Class({
         }
         this._setEventSource(eventSource);
         this._setEventsVisibility(showEvents);
+
+        // This needs to be handled manually, as the code to
+        // autohide separators doesn't work across the vbox
+        this._dateAndTimeSeparator.actor.visible = Main.sessionMode.allowSettings;
     },
 
     _updateClockAndDate: function() {